﻿@model SAIM.Models.GetFileEditionsViewModel
@using SAIM.Models

<div class="modal-dialog modal-lg">
    <!-- Modal content-->
    <div class="modal-content" style="overflow-y: auto; margin-top: 10%;">
        <div class="modal-header">
            <h4 class="text-primary"><span class="glyphicon glyphicon-time"></span> Historial de ediciones del archivo</h4>
        </div>
        <div class="modal-body">
            <ul class="list-group">
                @if (Model.attachments.Count > 0)
                {
                    foreach (TicketAttachment element in Model.attachments)
                    {
                        <li class="list-group-item">
                            <form class="form-horizontal">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <h5 class="list-group-item-heading"><b>@element.UserName</b></h5>
                                    </div>
                                    <div class="comment-area col-sm-6">
                                        <p class="list-group-item-text">@element.FileName</p>
                                    </div>
                                    <div class="comment-area col-sm-2">
                                        <p class="list-group-item-text">@element.CreationDate</p>
                                    </div>
                                    <div class="comment-area col-sm-2">
                                        <p class="list-group-item-text">@element.FileSize</p>
                                    </div>
                                    <div class="comment-area col-sm-2">
                                        <div title="Descargar">
                                            <a href="@Url.Action("GetAttachedFile", "Tickets")/@element.IdTicket?attachmentId=@element.Mask" role="button" class="btn btn-primary"> 
                                               <span class="glyphicon glyphicon-arrow-down" aria-hidden="true"></span>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </li>
                    }
                }
                else
                {
                    <li class="list-group-item list-group-item-info">Este archivo no contiene ediciones.</li>
                }
            </ul>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-danger btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Cerrar</button>
        </div>
    </div>
</div>